package com.xuyuan.main;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class GuxtScroe {

	public static void main(String[] args) {
		WebClient webClient = new WebClient(BrowserVersion.FIREFOX_38);
		HtmlPage page = null;
		try {
			page = webClient.getPage("http://bbs.gxut.edu.cn/chengji/index.html");
			// 输入用户名和密码
			HtmlInput username = (HtmlInput)page.getHtmlElementById("login_name");
			username.setValueAttribute("201200403012");
			HtmlInput password = (HtmlInput) page.getHtmlElementById("login_padd");
			password.setValueAttribute("07151334");
			// 获取提交按扭
			HtmlInput loginBtn = (HtmlInput)page.getHtmlElementById("login_buttom");
			// 点击提交表单
			HtmlPage resultPage = loginBtn.click();
			System.out.println(resultPage.asText());
		} catch (Exception e) {
		}
		webClient.close();
		
		
		
		
		
		
		
	}
}
